package com.atguigu.guli.service.statistics.controller.admin;


import com.atguigu.guli.service.base.result.R;
import com.atguigu.guli.service.statistics.service.DailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2021-11-18
 */
@RestController
@RequestMapping("admin/statistics/daily")
public class AdminDailyController {

    @Autowired
    DailyService dailyService;

    //生成统计，并将统计数据插入到统计表格的接口
    @PostMapping("CreateStatistics/{day}")
    public R CreateStatistics(@PathVariable String day){
        dailyService.CreateStatistics(day);
        return R.ok();
    }

    //查询指定日期期间的用户的数量
    @GetMapping("getDaliyInfo/{begin}/{end}")
    public R getDaliyInfo(@PathVariable String begin,@PathVariable String end){
       Map map =  dailyService.getDaliyInfo(begin,end);
       return R.ok().data(map);
    }

}

